package com.zhang.test_zhang.controller;

import com.zhang.test_zhang.entity.Trade;
import com.zhang.test_zhang.service.TradeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/trade")
@Slf4j
public class TradeController {

    @Autowired
    private TradeService tradeService;

    //新增商品
    @PostMapping("/addTrade")
    public String addTrade(@RequestBody Trade trade) {
        log.info("新增商品：{}",trade);
        return tradeService.addTrade(trade);
    }
}
